package com.wwg.reflect.test1;

import lombok.SneakyThrows;
import sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl;

import java.lang.reflect.Method;
import java.lang.reflect.Type;

/**
 * @author wuweigang
 */
public class TestGetInnerType {

    @SneakyThrows
    public static void main(String[] args) {
        Class<?> aClass = Class.forName("com.wwg.controller.TestExceptionController");
        for (Method method : aClass.getMethods()) {
            try {
                Type actualTypeArgument = ((ParameterizedTypeImpl) method.getGenericReturnType()).getActualTypeArguments()[0];
                Class<? extends Type> aClass1 = actualTypeArgument.getClass();

                System.out.println("stop");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

    }
}
